{% extends "layout.html.twig" %}
{% block content %}
		<div class="row">
			<div class="col-md-12">
			<h2>Events übersicht Jahr {{ current_year|date('Y') }}</h2>
			{% set participate = -1 %}
			{% for inscription in inscriptions %}
				{% if inscription.userid == user.id %}
					{% if inscription.participate == -1 %}
						{% set participate = -1 %}
						<p style="color:green; font-size:16px;">Du hast Dich noch nicht <a style="text-decoration:underline; color:green;" href="{{ path('setevent_user', { 'id': inscription.information }) }}">angemeldet</a> für den Event vom {{ inscription.datum|date('d-m-Y') }} !</p>					
					{% elseif inscription.participate == 0 %}
						{% set participate = 0 %}
						<p style="color:green; font-size:16px;">Leider nimmst du am Event vom {{ inscription.datum|date('d-m-Y') }} nicht teil !</p>
					{% else %}
						{% set participate = 1 %}
						<p style="color:green; font-size:16px;">Du bist für den Event vom {{ inscription.datum|date('d-m-Y') }} dabei !</p>
					{% endif %}
				{% endif %}
			{% endfor %}
			
			
			<table class="table events">
				<thead>
					<tr>
						<td><strong>Datum</strong></td>
						<td><strong>Organisator</strong></td>
						<td><strong>{% if participate == -1 %}An/Abmelden{% else %}Infos Event / Pinnwand schreiben</strong></td>{% endif %}
						<td><strong>Anmeldungen</strong></td>
					</tr>
				</thead>
				<tbody>
				{% for information in informations %}
					<tr>
	        			<td>{{ information.datum|date('d-m-Y') }}</td>
	        			<td>{{ information.firstname }} {{ information.lastname }}&nbsp;{% if information.uid == user.id and information.actuell_information == 1 %}<a href="{{ path('setevent_organisator', { 'id': information.id }) }}"><span class="glyphicon glyphicon-edit" aria-hidden="true"></span></a>{% endif %}</td>
	        			<td>
	        				{% if information.actuell_information == 1 and participate == -1 %}
	        					<a href="{{ path('setevent_user', { 'id': information.id }) }}"><span class="glyphicon glyphicon-edit" aria-hidden="true"></span></a>
	        				{% elseif  information.actuell_information == 1 and participate == 0 or information.actuell_information == 1 and participate == 1 %}
	        					<a href="{{ path('new_feedback', { 'id': information.id }) }}"><span class="glyphicon glyphicon-edit" aria-hidden="true"></span></a>
	        				{% elseif information.actuell_information == 2 %}
	        					<a href="{{ path('new_feedback', { 'id': information.id }) }}"><span class="glyphicon glyphicon-info-sign" aria-hidden="true"></span></a>
	        				{% endif %}
	        			</td>
	        			<td>{% if information.actuell_information >= 1 %}<a href="{{ path('anmeldungen', { 'id': information.id }) }}"><span class="glyphicon glyphicon-info-sign" aria-hidden="true"></span></a>{% endif %}</td>
        			</tr>
    			{% endfor %}
    			</tbody>
			</table>
			</div>
		</div>
			
{% endblock %}			